﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.IO;

namespace RESTful
{    
    [ServiceContract]
    [XmlSerializerFormat]
    public interface IService1
    {
        [OperationContract]
        [WebGet(UriTemplate = "GetCategory", ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Bare)]
        DTO.DanhMuc_DTO[] GetCategory();

        [OperationContract]
        [WebGet(UriTemplate = "GetFeed/{MaDanhMuc}", ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Bare)]
        DTO.DataFeed_DTO[] GetFeed(String MaDanhMuc);

        [OperationContract]
        [WebGet(UriTemplate = "GetLink/{ID}", ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Bare)]
        DTO.FeedPersonal_DTO[] GetLink(String ID);

        [OperationContract]
        [WebGet(UriTemplate = "GetFeedByID/{ID}", ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Bare)]
        DTO.DataFeed_DTO[] GetFeedByID(String ID);

        [OperationContract]
        [WebInvoke(UriTemplate = "/Insert/", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare)]
        void Insert(Stream s);

        [OperationContract]
        [WebInvoke(UriTemplate = "/Update/", Method = "POST", BodyStyle = WebMessageBodyStyle.Bare)]
        void Update(Stream s);

        [OperationContract]
        [WebGet(UriTemplate = "Delete/{MaFeed}", ResponseFormat = WebMessageFormat.Xml, BodyStyle = WebMessageBodyStyle.Bare)]
        void Delete(String MaFeed);
    }    
}
